
<!DOCTYPE html
		PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  xmlns:th="http://www.thymeleaf.org" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport"
			content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1.0, user-scalable=no" />
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="format-detection" content="telephone=no" />
		<meta name="wap-font-scale" content="no" />
		<meta name="Keywords" content="客家话,客家话翻译,客家话转换,普通话翻译客家话">
		<meta name="Description" content="想将普通话翻译成客家话？试试这个由SYNDICT开发的小工具吧。无字数限制，而且还支持客语注音哦！">
		<title>客普翻译器 - 客家话翻译普通话</title>
		<link rel="stylesheet" type="text/css" href="/css/public.css" />
		<link rel="stylesheet" type="text/css" href="/css/mandarin_to_hakka.css" />
		<script type="text/javascript" src="/js/jquery-1.11.1.min.js"></script>
		<script type="text/javascript" src="/js/iscroll.js"></script>
		<script type="text/javascript" src="/js/common.js"></script>
		<script type="text/javascript">
			function checkout() {
				var item = $("#place").val();
				var content = $("#raw_content").val();
				var url = "checkout.php";
				//alert(item);
				//alert(content);
				$.post(url, {
					item: item,
					content: content
				}, function(result) {
					//alert(result);
					var json = result; //获得查词结果数据包
					obj = eval("(" + json + ")");
					//alert(obj[0]+obj[1]+obj[2]);
					$("#raw_text").text(obj[0]);
					$("#result1").text(obj[1]);
					$("#result2").html(obj[2]);
					//修改超鏈接
					$("#add_word_btn").attr("href", "/search_empty.php?word=" + obj[0] + "&amp;item=hak&amp;place=hui_yang");
				});
			}

			$(document).ready(function() {
				$(".menu_box li:eq(3)").addClass("choose_menu");
				$(".mobile_menu_title").text("客普翻譯");
				var Request = GetRequest();
				if (Request) {
					$("#raw_content").val(Request["word"]);
					checkout();
				}

				$("#place").change(function() {
					//alert($(this).val());
					var checkText = $("#place").find("option:selected").text();
					$("#place_tab").text(checkText);
				});
			});

			/**************************页面载入时获取url的参数值****************************/
			function GetRequest() {
				var url = location.search; //获取url中"?"符后的字串
				var theRequest = new Object();
				if (url.indexOf("?") != -1) {
					var str = url.substr(1);
					strs = str.split("&amp;");
					for (var i = 0; i &lt; strs.length; i++) {
						theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
					}
				} else {
					return false;
				}
				return theRequest;
			}
		</script>
	</head>
	<style>
		#footer{
			position: fixed;
			left: 0px;
			bottom: 0px;
			width: 100%;
			height: 60px;
			background-color: #eeee;
			z-index: 9999;
			/*background-image: url("static/image/footer/footer.png");*/
			/*background:url(image/footer/footer.png) no-repeat 50% 50%;*/
		}
	</style>
	<body>

		<div class="outBox">

			<!--页头 开始-->
			<div th:include="common/head :: top" class="head"></div>
			<!--页头 结束-->

			<div class="content">
				<div class="page_title">
					<img src="/image/common/logo_icon.png">
					<span>客普翻译器</span>
				</div>

				<div class="main_box">
					<!-- 原文输入 -->
					<div class="main_boxL">
						<div class="main_boxL_top">原文</div>
						<div class="tAr_box">
							<textarea id="raw_content">把普通话翻译成客家话的小工具。</textarea>
						</div>
						<div style="padding-top:10px; font-size:1.2em">觉得这是一个独立词组？花几秒钟帮薪典<a target="_blank"
								href="/search_empty.php?word=" id="add_word_btn" style="color:blue">添加词组</a>。</div>
					</div>
				</div>
				<!-- 结果呈现 -->
				<div class="main_boxR">
					<div class="main_boxR_top">
						<div class="sel_lan">
							<span id="place_tab">梅縣音</span>
							<select name="place" id="place">
								<option value="mx">梅縣音</option>
								<option value="hy">惠陽音</option>
								<option value="wh">五華音</option>
								<option value="yd">英德音</option>
								<option value="jl">蕉嶺音</option>
								<option value="xn">興寧音</option>
								<option value="hk">綜合音</option>
							</select>
							<i class="sel_sj"></i>
						</div>
						<button class="tran_btn" onclick="checkout();">翻译</button>
					</div>

					<div class="result_box">
						<ul class="res_box">
							<li>
								<h2>原文</h2>
								<div class="original_text" id="raw_text">把普通话翻译成客家话的小工具。</div>
							</li>
							<li>
								<h2>翻译结果</h2>
								<div class="original_text" id="result1">將普通話翻譯成客家話个小工具。</div>
							</li>
							<li>
								<h2>注音后</h2>
								<div class="result_text" id="result2">
									<ruby>
										<rb>將</rb>
										<rt>ziong<sup>44</sup></rt>
									</ruby><ruby>
										<rb>普</rb>
										<rt>pu<sup>31</sup></rt>
									</ruby><ruby>
										<rb>通</rb>
										<rt>tung<sup>44</sup></rt>
									</ruby><ruby>
										<rb>话</rb>
										<rt>fa<sup>52</sup></rt>
									</ruby><ruby>
										<rb>翻</rb>
										<rt>fan<sup>44</sup></rt>
									</ruby><ruby>
										<rb>译</rb>
										<rt>-id<sup>5</sup></rt>
									</ruby><ruby>
										<rb>成</rb>
										<rt>siin<sup>11</sup></rt>
									</ruby><ruby>
										<rb>客</rb>
										<rt>hag<sup>1</sup></rt>
									</ruby><ruby>
										<rb>家</rb>
										<rt>ga<sup>44</sup></rt>
									</ruby><ruby>
										<rb>话</rb>
										<rt>fa<sup>52</sup></rt>
									</ruby><ruby>
										<rb>个</rb>
										<rt>ge<sup>52</sup></rt>
									</ruby><ruby>
										<rb>小</rb>
										<rt>siau<sup>31</sup></rt>
									</ruby><ruby>
										<rb>工</rb>
										<rt>gung<sup>44</sup></rt>
									</ruby><ruby>
										<rb>具</rb>
										<rt>ki<sup>52</sup></rt>
									</ruby>。
								</div>
							</li>
						</ul>
						<div class="edit_result">
							<span>
								<i></i>
								<a href='../hanzi_to_pinyin/addpairs.php' target='_blank'>修正结果</a>
							</span>
						</div>
					</div>
				</div>

				<div class="clear"></div>

			</div>

		</div>

<!--		<div id="footer" style="text-align: center">-->
<!--			<img th:src="@{/image/footer/11.png}"/>-->
<!--		</div>-->
	</body>
</html>
